<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>文档标题</title>
    <script>

      function maxr(char) {
        if (char.length === 0) return 0;

        let max = 0, temp = 1, index = 0;
        for (let i = 1; i < char.length; i++) {
          if (char[i] === char[i - 1]) {
            temp++;
          } else {
            temp = 1;
          }
          if (temp > max) {
            max = temp;
            index = i;
          }
        }
        return char.slice(index - max + 1, index + 1);
      }

      alert(maxr("mmmiijjjjkkkkkkssptr"));
    </script>
</head>
<body>
<h1>我的第一个HTML页面</h1>
<p>我的第一个段落。</p>
</body>
</html>
